<link href="__STATIC__/admin/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<div class="row">
    <div class="col-md-12">
        <div class="box box-primary">
            <div class="box-header">
                <h3 class="box-title">添加文章</h3>
            </div>
            <form id="addCategoryForm">
                <div class="box-body">
                    <div class="form-group">
                        <label for="cname">文章标题</label>
                        <input type="text" class="form-control"  name="article_title" id="article_title" placeholder="请输入文章标题">

                    </div>
                    <div class="form-group">
                        <label for="cname">请选择文章分类</label>
                        <select name="cid" id="cid" class="form-control">
                            <option value="">请选择文章分类</option>
                            {volist name="category"  id="v"}
                            <option value="{$v.cid}">{$v.cname}</option>
                            {/volist}
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="article_abstract">请填写文章摘要</label>
                        <textarea name="article_abstract" id="article_abstract" cols="30" rows="5" class="form-control"></textarea>
                    </div>

                    <div class="form-group">
                        <label for="article_content">请填写文章内容</label>
                        <textarea name="article_content"  id="article_content"></textarea>
                    </div>

                </div>

                <div class="box-footer text-center">
                    <button type="button" onclick="submitData('addCategoryForm');" class="btn btn-primary">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="__STATIC__/admin/js/jquery.min.js"></script>//jquery

<script  src="__STATIC__/Ueditor/ueditor.config.js"></script>
<script  src="__STATIC__/Ueditor/ueditor.all.min.js"> </script>
<script  src="__STATIC__/Ueditor/lang/zh-cn/zh-cn.js"></script>
<script >
    $(function () {
        window.UEDITOR_HOME_URL = "__STATIC__/Ueditor/";
        window.UEDITOR_CONFIG.initialFrameWidth="100%"
        window.UEDITOR_CONFIG.initialFrameHeight =600;
        var ue = UE.getEditor('article_content');



    });
</script>
<script>
    function  submitData(formid){
        var data =$('#'+formid).serialize();//将表单数据序列化
        $.ajax({
            url:"{:url('admin/Article/handle')}",
            data:data,
            type:'POST',
            datatype:'json',
            success:function(d){
                //d===  {'code'=>1,'msg'=>'添加成功'}   json
                alert(d.msg);

            }
        })
    }
</script>